package com.screen.screendisplay.service.impl.dryport;

import com.screen.screendisplay.entity.dryport.DryportOverviewItem;
import com.screen.screendisplay.mapper.dryport.DryportOverviewItemMapper;
import com.screen.screendisplay.service.dryport.DryportOverviewItemService;
import com.screen.screendisplay.vo.dryport.OverviewVO;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 主要指标情况表 服务实现类
 * </p>
 *
 * @author xuesong
 * @since 2025-08-23
 */
@Service
public class DryportOverviewItemServiceImpl extends ServiceImpl<DryportOverviewItemMapper, DryportOverviewItem> implements DryportOverviewItemService {

    @Override
    public OverviewVO getStatsByYear(Integer year) {
        // 从数据库查询数据
        DryportOverviewItem entity = baseMapper.getStatsByYear(year);
        
        if (entity == null) {
            return null;
        }
        
        // 转换为VO对象
        OverviewVO vo = new OverviewVO();
        BeanUtils.copyProperties(entity, vo);
        return vo;
    }

}
